package com.syedu.cels.factory;

import com.syedu.cels.constants.IConstants;
import com.syedu.cels.entity.Base;
import com.syedu.cels.entity.Vocabulary;
import com.syedu.cels.entity.Word;

/**
 * description：工厂类
 * @author Administrator
 * @date 2022/3/21 16:09
 */
public class BaseFactory implements IConstants {
    public static Base getBase(int type){
        Base base = null;
        if(type == WORD){
            base = new Word();
        }else if(type == VOCABULARY){
            base = new Vocabulary();
        }else{
            throw new IllegalArgumentException("参数不合法!");
        }
        return base;
    }
}